import { Column, Entity, PrimaryGeneratedColumn, Tree, TreeChildren, TreeParent } from 'typeorm';

@Entity()
@Tree("closure-table")
export class GoodType {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    comment: "分类名称",
    unique:true
  })
  name: string;

  @TreeChildren()
  children: GoodType[];

  @TreeParent()
  parent: GoodType;
}